const MyPromise = require('./MyPromise2')
const promise = new MyPromise((resolve, reject) => {
  console.log(1);
  setTimeout(() => {
    resolve('123')
  }, 1110)
})

function others () {
  return new MyPromise((resolve, reject) => {
    setTimeout(() => {
      resolve('321')
    }, 1500)
  })
}


promise.then(res => {
  console.log(res, 123)
  return others()
}).then(res1 => {
  console.log(res1, 2)
})

for (const key of [0,0,0]) {
  console.log(key);
}